package org.example.controller;

import org.example.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-03-13
 * Time：22:24
 */
//搭配任意类注解
@Component
public class GetUserBean {
    @Bean(value = "user_default")
    User user() {
        User user = new User();
        user.setUserId(1);
        user.setUserName("GetUserBean类：zhangsan");
        user.setAge(19);
        return user;
    }
}
